1: | msort(nil) | → nil | |
2: | msort(x . y) | → min(x,y) . msort(del(min(x,y),x . y)) | |
3: | min(x,nil) | → x | |
4: | min(x,y . z) | → if(x ≤ y,min(x,z),min(y,z)) | |
5: | del(x,nil) | → nil | |
6: | del(x,y . z) | → if(x = y,z,y . del(x,z)) | |
7: | MSORT(x . y) | → MSORT(del(min(x,y),x . y)) | |
8: | MSORT(x . y) | → DEL(min(x,y),x . y) | |
9: | MSORT(x . y) | → MIN(x,y) | |
10: | MIN(x,y . z) | → MIN(x,z) | |
11: | MIN(x,y . z) | → MIN(y,z) | |
12: | DEL(x,y . z) | → DEL(x,z) | |